#include "config.h"


uint64_t chipid=0;
unsigned long control_time;
char host_name[30]="ESP:";
Preferences pref;

uint8_t pow_state=0;//咖啡机开关
uint8_t pub_state=0;
uint8_t work_state=0;//工作状态
// uint8_t 
int mqtt_jzz=0;
uint natie_time=60000;
uint kabuqinuo_time=90000;
uint yishi_time=60000;
uint clean_time=60000;
uint yeru_pluse=2400;
uint max_time=60000;
uint channel1_pluse=24000;
uint channel2_pluse=2400;
uint channel3_pluse=2400;
uint channel4_pluse=2400;
bool bee_pluse=false;
uint work_times=0;
bool door_reset=false;

/**
 * @brief 蜂鸣器判断参数
 * 旧机器2451 （2000，2500）蜂鸣器长鸣，渣盒  新机器3566（3300，3700）
 */
uint bee_interve1 = 2000;
uint bee_interve2 = 2500;
/**
 * @brief 咖啡机类型
 *  1：得颐
 *  2：新咖啡机
 * 
 */
uint machine_type = 1;

/**
 * @brief 
 * wifi config
 */

uint16_t mqtt_port = 1883;

uint8_t ip[4]={192,18,44,166};//ip
String mqtt_server="mqtt.hhwl.lhb.ink";

String SSID="hhiot";
String PASSWD="Hanhong456";

uint8_t mac_uint8[6]={0};
char mac[17]="";

WiFiClient wifi_client;                                                         // 定义wifiClient实例
/**
 * @brief 
 * mqtt config
 */
PubSubClient mqtt_client;    
char mqtt_sub_topic[40]="";
char mqtt_pub_topic[40]="";
char account[40]="";
char passwd[40]="coffee";

/**
 * @brief 二值信号量
 * 
 */
volatile SemaphoreHandle_t bleconfigSemaphore;




/**
 * @brief 
 * hx711
 */
HX711 scale1;
HX711 scale2;

/**
 * @brief 
 * hall
 */

uint64_t hall_count=0;